*****Conscription and Military Service: Do They Result in Future Violent and Non-Violent Incarcerations and Recidivism?  Wang, Flores-Lagunes 2020*****

cd "C:\Users\xinto\Dropbox\Vietnam Veteran Paper\Crime Paper\2020 JHR Data\1. Main Dataset"

set more off
clear all
set memory 350m
set matsize 800

*****1991: Federal Survey******
clear
use SISFFC1991

***Study***
gen study=19912

***ID***
gen id=IDNUM

***Male***
tab SC0100, nol
gen male=9
replace male=1 if SC0100==1 
replace male=0 if SC0100==2 
tab male

***Final Weight***
gen weight=WEIGHT
egen total_male_inmate=total(weight) if male==1 
tab total_male_inmate

***Birth Month***
tab SC0110, nol
gen birthMonth=99
replace birthMonth=SC0110 if SC0110!=98
tab birthMonth

***Birth Day***
tab SC0120, nol
gen birthDay=99 
replace birthDay=SC0120 if SC0120!=98
tab birthDay

***Birth Year***
tab SC0130, nol
gen birthYear=99 
replace birthYear=SC0130 if SC0130!=98
tab birthYear

***Age (no missing values)***
tab SC0150, nol
gen age=99
replace age=SC0150 if SC0150!=98 
tab age

***White***
tab SC0161, nol
gen white=9 
replace white=1 if SC0161==1
replace white=0 if (SC0161==2 | SC0161==3 | SC0161==4 | SC0161==5)
tab white

***Hispanic***
tab SC0170, nol
gen spainHisp=9
replace spainHisp=1 if SC0170==1
replace spainHisp=0 if SC0170==2
tab spainHisp

****Married****
tab SC0210, nol
gen married=9
replace married=1 if SC0210==1
replace married=0 if (SC0210==2| SC0210==3 | SC0210==4 | SC0210==5 ) 
tab married

***Divorced (no missing values)***
gen divorced=9
replace divorced=1 if SC0210==3
replace divorced=0 if (SC0210==1| SC0210==2 | SC0210==4 | SC0210==5 )
tab divorced

***Never Married***
gen neverMarried=9
replace neverMarried=1 if SC0210==5
replace neverMarried=0 if (SC0210==1| SC0210==2 | SC0210==3 | SC0210==4)
tab neverMarried

***Ever served in the military***
tab SC0220, nol
gen armForce=9 
replace armForce=1 if SC0220==1
replace armForce=0 if SC0220==2
tab armForce

***Vietnam Era 
tab SC0230, nol 
gen vietEra=9 
replace vietEra=1 if SC0230==1 
replace vietEra=0 if SC0230==2 | SC0220==2
tab vietEra

***Stationed in Vietnam***
tab SC0240
gen stationedVietnam=9
replace stationedVietnam=1 if SC0240==1
replace stationedVietnam=0 if SC0240==2 | vietEra==0
tab stationedVietnam

***Saw Combat***
tab SC0250
gen sawCombat=9
replace sawCombat=1 if SC0250==1
replace sawCombat=0 if SC0250==2 | stationedVietnam==0
tab sawCombat

***Serve Branches*** 
tab SC0280, nol
gen serveBranch=SC0280 

***Serve in Army***
gen army=9
replace army=1 if SC0280==1
replace army=0 if (SC0280!=1 & SC0280!=8) | SC0220==2 
tab army

***Month Enter Military***
tab SC0290, nol
gen monthEnterMilitary=99
replace  monthEnterMilitary=SC0290 if SC0290!=98 
tab monthEnterMilitary

***Year Enter Military***
tab SC0300, nol
gen yearEnterMilitary=99 
replace yearEnterMilitary=SC0300 if SC0300!=98  
tab yearEnterMilitary

***Month Discharged Military***
tab SC0310, nol
gen monthDischargedMilitary=99
replace monthDischargedMilitary=SC0310 if SC0310!=98
tab monthDischargedMilitary

***Year Discharged Military***
tab SC0320, nol
gen yearDischargedMilitary=99
replace yearDischargedMilitary=SC0320 if SC0320!=98 
tab yearDischargedMilitary

/***Member of National Goard***
tab V435
gen memberReserve=9 
replace memberReserve=1 if V435==1
replace memberReserve=0 if V435==2
 

***Eligible for VA Benefits or Education***
tab V438
gen eligibleVA=9
replace eligibleVA=1 if V438==1 
replace eligibleVA=0 if V438==2 
*/ 

***Convicted Status*** 
tab SC0340
gen convictedStatus=9
replace convictedStatus=1 if SC0340==1
replace convictedStatus=0 if SC0340==2
tab convictedStatus

***Month of Admission***
tab SC8845, nol
gen admissionMonth=99
replace admissionMonth=SC8845 if SC8845!=98
tab admissionMonth

***Year of Admission***
tab SC8855, nol
gen admissionYear=99
replace admissionYear=SC8855 if SC8855!=98
tab admissionYear

***Current Offense 1 ***
tab SC8815, nol
gen currentOffense1=999
replace currentOffense1=SC8815 if SC8815!=998
tab currentOffense1

***Current Offense 2 ***
tab SC8820, nol
gen currentOffense2=999
replace currentOffense2=SC8820 if SC8820!=998
tab currentOffense2

***Current Offense 3***
tab SC8825, nol
gen currentOffense3=999
replace currentOffense3=SC8825 if SC8825!=998
tab currentOffense3

***Current Offense 4***
tab SC8830, nol
gen currentOffense4=999
replace currentOffense4=SC8830 if SC8830!=998
tab currentOffense4

***Current Offense 5***
tab SC8835, nol
gen currentOffense5=999
replace currentOffense5=SC8835 if SC8835!=998
tab currentOffense5 




***LS Current Offense***
***Current Offense 1 ***
tab SC8815, nol
gen LScurrentOffense1=999
replace LScurrentOffense1=SC8815 if SC8815!=998
tab LScurrentOffense1

***Current Offense 2 ***
tab SC8820, nol
gen LScurrentOffense2=999
replace LScurrentOffense2=SC8820 if SC8820!=998
tab LScurrentOffense2

***Current Offense 3***
tab SC8825, nol
gen LScurrentOffense3=999
replace LScurrentOffense3=SC8825 if SC8825!=998
tab LScurrentOffense3

***Current Offense 4***
tab SC8830, nol
gen LScurrentOffense4=999
replace LScurrentOffense4=SC8830 if SC8830!=998
tab LScurrentOffense4

***Current Offense 5***
tab SC8835, nol
gen LScurrentOffense5=999
replace LScurrentOffense5=SC8835 if SC8835!=998
tab LScurrentOffense5 

***Controlling Offense 5***
tab SC8840, nol
gen LScurrentOffense6=999
replace LScurrentOffense6=SC8840 if SC8840!=998
tab LScurrentOffense6 





***Month of Arrest 
tab SC8865, nol 
gen arrestMonth=99
replace arrestMonth=SC8865 if SC8865!=98
tab arrestMonth

***Year of Arrest 
tab SC8870, nol 
gen arrestYear=99 
replace arrestYear=SC8870 if SC8870!=98
tab arrestYear

***************Prior Incarceration***************
***Previous Incarceration***
tab SC8885, nol
gen priorIncarceration=9
replace priorIncarceration=1 if SC8885==1 
replace priorIncarceration=0 if SC8885==2 
tab priorIncarceration 

***Total times of arrested*** 
tab SC4665, nol 
gen totalArrest=999
replace totalArrest=SC4665 if SC4665!=998
tab totalArrest

***Age at First Arrest***
tab SC4670, nol
gen ageFirstArrest=99 
replace ageFirstArrest=SC4670 if SC4670!=98 
tab ageFirstArrest

***Reason for the arrest offense 1***
tab SC4680, nol 
gen firstArrestOffense1=999
replace firstArrestOffense1=SC4680 if SC4680!=998
tab firstArrestOffense1

***Reason for the arrest offense 2***
tab SC4685, nol 
gen firstArrestOffense2=999
replace firstArrestOffense2=SC4685 if SC4685!=998
tab firstArrestOffense2

***Reason for the arrest offense 3***
tab SC4690, nol 
gen firstArrestOffense3=999
replace firstArrestOffense3=SC4690 if SC4690!=998
tab firstArrestOffense3

***Reason for the arrest offense 4***
tab SC4695, nol 
gen firstArrestOffense4=999
replace firstArrestOffense4=SC4695 if SC4695!=998
tab firstArrestOffense4

***Reason for the arrest offense 5***
tab SC4700, nol 
gen firstArrestOffense5=999
replace firstArrestOffense5=SC4700 if SC4700!=998
tab firstArrestOffense5

/***Age First Incarcerated***
tab V363
gen ageFirstIncarcerated=999 
replace ageFirstIncarcerated=V363 if (V363!=98 & V363!=99)
tab ageFirstIncarcerated
*/ 

***Ever on Probation***
tab SC4710, nol
gen everProbation=9
replace everProbation=1 if SC4710==1 
replace everProbation=0 if SC4710==2 
tab everProbation

***Total times on probation as a juvenile*** 
tab SC4715 SC4720, nol 
gen timesOnProbationJuv=99 
replace timesOnProbationJuv=SC4715 if SC4715!=98
replace timesOnProbationJuv=0 if SC4720==0
replace timesOnProbationJuv=0 if everProbation==0
tab timesOnProbationJuv

***age first on Probation as Juvenile***
tab SC4725, nol
gen ageProbationJuv=SC4725
replace ageProbationJuv=99 if ageProbationJuv==98
tab ageProbationJuv

***Offense 1 on Probation as Juvenile***
tab SC4730, nol
gen firstProbOffenseJuv1=999
replace firstProbOffenseJuv1=SC4730 if SC4730!=998
tab firstProbOffenseJuv1

***Offense 2 on Probation as Juvenile***
tab SC4735, nol
gen firstProbOffenseJuv2=999
replace firstProbOffenseJuv2=SC4735 if SC4735!=998
tab firstProbOffenseJuv2

***Offense 3 on Probation as Juvenile***
tab SC4740, nol
gen firstProbOffenseJuv3=999
replace firstProbOffenseJuv3=SC4740 if SC4740!=998
tab firstProbOffenseJuv3

***Offense 4 on Probation as Juvenile***
tab SC4745, nol
gen firstProbOffenseJuv4=999
replace  firstProbOffenseJuv4=SC4745 if SC4745!=998
tab firstProbOffenseJuv4

***Offense 5 on Probation as Juvenile***
tab SC4750, nol
gen firstProbOffenseJuv5=999
replace firstProbOffenseJuv5=SC4750 if SC4750!=998
tab firstProbOffenseJuv5

***Times on Probation as Adult***
tab SC4755 SC4760, nol
gen timesProbationAdu=99
replace timesProbationAdu=SC4755 if SC4755!=998
replace timesProbationAdu=0 if SC4760==0
replace timesProbationAdu=0 if everProbation==0
tab timesProbationAdu

***Age first on Probation as a adult***
tab SC4765, nol
gen ageProbationAdu=SC4765
replace ageProbationAdu=99 if ageProbationAdu==98
tab ageProbationAdu

***Offense 1 on Probation as Adult***
tab SC4770, nol
gen firstProbOffenseAdu1=SC4770
replace firstProbOffenseAdu1=999 if firstProbOffenseAdu1==998
tab firstProbOffenseAdu1

***Offense 2 on Probation as Adult***
tab SC4775, nol
gen firstProbOffenseAdu2=SC4775
replace firstProbOffenseAdu2=999 if firstProbOffenseAdu2==998
tab firstProbOffenseAdu2

***Offense 3 on Probation as Adult***
tab SC4780, nol
gen firstProbOffenseAdu3=SC4780
replace firstProbOffenseAdu3=999 if firstProbOffenseAdu3==998
tab firstProbOffenseAdu3

***Offense 4 on Probation as Adult***
tab SC4785
gen firstProbOffenseAdu4=SC4785
replace firstProbOffenseAdu4=999 if firstProbOffenseAdu4==998
tab firstProbOffenseAdu4

***Offense 5 on Probation as Adult***
tab SC4790
gen firstProbOffenseAdu5=SC4790
replace firstProbOffenseAdu5=999 if firstProbOffenseAdu5==998
tab firstProbOffenseAdu5

***Convicted for Drunkeness (petty off)***
tab SC4795, nol
gen convDrunk=9
replace convDrunk=1 if SC4795!=0 & SC4795!=8
replace convDrunk=0 if SC4795==0 
tab convDrunk

***Served for petty off 
tab SC4800, nol
gen servDrunk=9
replace servDrunk=1 if SC4800==1 
replace servDrunk=0 if (SC4800==2 | (SC4800==8 & SC4795==0))
tab servDrunk

***Times as a Juvenile: Serve for Drunkeness***
tab SC4805, nol
gen timesDrunkAsJuv=99
replace timesDrunkAsJuv=SC4805 if SC4805!=98 
replace timesDrunkAsJuv=0 if (SC4810==0 | servDrunk==0)
tab timesDrunkAsJuv

***Times for Drunkeness as Adult***
tab SC4815, nol
gen timesDrunkAsAdu=9999
replace timesDrunkAsAdu=SC4815 if SC4815!=9998 
replace timesDrunkAsAdu=0 if (SC4820==0 | servDrunk==0)
tab timesDrunkAsAdu

***Serve Other Than Drunkeness***
tab SC4825, nol
gen servOther=9 
replace servOther=1 if SC4825==1 
replace servOther=0 if SC4825==2 
tab servOther

***Serve times for Others as Juvenile***
tab SC4830, nol
gen timesOtherJuv=99
replace timesOtherJuv=SC4830 if SC4830!=98 
replace timesOtherJuv=0 if (servOther==0 | SC4835==0)
tab timesOtherJuv

***Serve times for Others as Adult***
tab SC4840, nol
gen timesOtherAdu=999
replace timesOtherAdu=SC4840 if SC4840!=998 
replace timesOtherAdu=0 if (servOther==0| SC4845==0)
tab timesOtherAdu

/***Times Confined (previously)***
drop timesConfined
tab V386
gen timesConfined=V386
replace timesConfined=999 if timesConfined==998
replace timesConfined=0 if V1118==2
tab timesConfined
*/ 

***First serve offense 1 (actually it is last served)***
tab SC4850, nol
gen firstServeOffense1=SC4850
replace firstServeOffense1=999 if firstServeOffense1==998
tab firstServeOffense1
***First serve offense 2***
tab SC4855, nol
gen firstServeOffense2=SC4855
replace firstServeOffense2=999 if firstServeOffense2==998
tab firstServeOffense2
***First serve offense 3***
tab SC4900, nol
gen firstServeOffense3=SC4900
replace firstServeOffense3=999 if firstServeOffense3==998
tab firstServeOffense3
***First serve offense 4***
tab SC4905, nol
gen firstServeOffense4=SC4905
replace firstServeOffense4=999 if firstServeOffense4==998
tab firstServeOffense4
***First serve offense 5***
tab SC4910, nol
gen firstServeOffense5=SC4910
replace firstServeOffense5=999 if firstServeOffense5==998
tab firstServeOffense5
***First serve admission Month***
tab SC5035, nol
gen firstAdmitMonth=99
replace firstAdmitMonth=SC5035 if SC5035!=98
tab firstAdmitMonth
***First serve admission Year***
tab SC5040, nol
gen firstAdmitYear=99
replace firstAdmitYear=SC5040 if SC5040!=98
tab firstAdmitYear
***First serve Age***
tab SC5050
gen firstAdmitAge=SC5050
replace firstAdmitAge=99 if firstAdmitAge==98 
tab firstAdmitAge
***First serve as adult***
tab SC5025
gen firstServeAdult=9
replace firstServeAdult=1 if (SC5025==1 | SC5025==2 ) 
replace firstServeAdult=0 if SC5025==3 
tab firstServeAdult


***Second serve offense 1***
tab SC5105, nol
gen secondServeOffense1=SC5105
replace secondServeOffense1=999 if secondServeOffense1==998
tab secondServeOffense1
***Second serve offense 2***
tab SC5110, nol
gen secondServeOffense2=SC5110
replace secondServeOffense2=999 if secondServeOffense2==998
tab secondServeOffense2
***Second serve offense 3***
tab SC5115, nol
gen secondServeOffense3=SC5115
replace secondServeOffense3=999 if secondServeOffense3==998
tab secondServeOffense3
***Second serve offense 4***
tab SC5120, nol
gen secondServeOffense4=SC5120
replace secondServeOffense4=999 if secondServeOffense4==998
tab secondServeOffense4
***Second serve offense 5***
tab SC5125, nol
gen secondServeOffense5=SC5125
replace secondServeOffense5=999 if secondServeOffense5==998
tab secondServeOffense5
***Second serve admission Month***
tab SC5140, nol
gen secondAdmitMonth=99
replace secondAdmitMonth=SC5140 if SC5140!=98
tab secondAdmitMonth
***Second serve admission Year***
tab SC5145, nol
gen secondAdmitYear=99
replace secondAdmitYear=SC5145 if SC5145!=98 
tab secondAdmitYear
***Second serve Age***
tab SC5155
gen secondAdmitAge=SC5155
replace secondAdmitAge=99 if secondAdmitAge==98 
tab secondAdmitAge
***Second serve as adult***
tab SC5130, nol
gen secondServeAdult=9
replace secondServeAdult=1 if (SC5130==1 | SC5130==2) 
replace secondServeAdult=0 if SC5130==3 
tab secondServeAdult


***Third serve offense 1***
tab SC5185, nol
gen thirdServeOffense1=SC5185
replace thirdServeOffense1=999 if thirdServeOffense1==998
tab thirdServeOffense1
***Third serve offense 2***
tab SC5190, nol
gen thirdServeOffense2=SC5190
replace thirdServeOffense2=999 if thirdServeOffense2==998
tab thirdServeOffense2
***Third serve offense 3***
tab SC5195, nol
gen thirdServeOffense3=SC5195
replace thirdServeOffense3=999 if thirdServeOffense3==998
tab thirdServeOffense3
***Third serve offense 4***
tab SC5200, nol
gen thirdServeOffense4=SC5200
replace thirdServeOffense4=999 if thirdServeOffense4==998
tab thirdServeOffense4
***Third serve offense 5***
tab SC5205, nol
gen thirdServeOffense5=SC5205
replace thirdServeOffense5=999 if thirdServeOffense5==998
tab thirdServeOffense5
***Third serve admission Month***
tab SC5220, nol
gen thirdAdmitMonth=99
replace thirdAdmitMonth=SC5220 if SC5220!=98
tab thirdAdmitMonth
***Third serve admission Year***
tab SC5225, nol
gen thirdAdmitYear=SC5225
replace thirdAdmitYear=99 if SC5225==98 
tab thirdAdmitYear
***Third serve Age***
tab SC5235
gen thirdAdmitAge=SC5235
replace thirdAdmitAge=99 if thirdAdmitAge==98 
tab thirdAdmitAge
***Third serve as adult***
tab SC5210, nol
gen thirdServeAdult=9
replace thirdServeAdult=1 if (SC5210==1|SC5210==2) 
replace thirdServeAdult=0 if SC5210==3 
tab thirdServeAdult


***Fourth serve offense 1***
tab SC5270, nol
gen fourthServeOffense1=SC5270
replace fourthServeOffense1=999 if fourthServeOffense1==998
tab fourthServeOffense1
***Fourth serve offense 2***
tab SC5275, nol
gen fourthServeOffense2=SC5275
replace fourthServeOffense2=999 if fourthServeOffense2==998
tab fourthServeOffense2
***Fourth serve offense 3***
tab SC5280, nol
gen fourthServeOffense3=SC5280
replace fourthServeOffense3=999 if fourthServeOffense3==998
tab fourthServeOffense3
***Fourth serve offense 4***
tab SC5285, nol
gen fourthServeOffense4=SC5285
replace fourthServeOffense4=999 if fourthServeOffense4==998
tab fourthServeOffense4
***Fourth serve offense 5***
tab SC5290, nol
gen fourthServeOffense5=SC5290
replace fourthServeOffense5=999 if fourthServeOffense5==998
tab fourthServeOffense5
***Fourth serve admission Month***
tab SC5305, nol
gen fourthAdmitMonth=99
replace fourthAdmitMonth=SC5305 if SC5305!=98
tab fourthAdmitMonth
***Fourth serve admission Year***
tab SC5310, nol
gen fourthAdmitYear=99
replace fourthAdmitYear=SC5310 if SC5310!=98
tab fourthAdmitYear
***Fourth serve Age***
tab SC5320
gen fourthAdmitAge=SC5320
replace fourthAdmitAge=99 if fourthAdmitAge==98 
tab fourthAdmitAge
***Fourth serve as adult***
tab SC5295, nol
gen fourthServeAdult=9
replace fourthServeAdult=1 if (SC5295==1 | SC5295==2) 
replace fourthServeAdult=0 if SC5295==3
tab fourthServeAdult


***Fifth serve offense 1***
tab SC5350, nol
gen fifthServeOffense1=SC5350
replace fifthServeOffense1=999 if fifthServeOffense1==998
tab fifthServeOffense1
***Fifth serve offense 2***
tab SC5355, nol
gen fifthServeOffense2=SC5355
replace fifthServeOffense2=999 if fifthServeOffense2==998
tab fifthServeOffense2
***Fifth serve offense 3***
tab SC5360, nol
gen fifthServeOffense3=SC5360
replace fifthServeOffense3=999 if fifthServeOffense3==998
tab fifthServeOffense3
***Fifth serve offense 4***
tab SC5365, nol
gen fifthServeOffense4=SC5365
replace fifthServeOffense4=999 if fifthServeOffense4==998
tab fifthServeOffense4
***Fifth serve offense 5***
tab SC5370, nol
gen fifthServeOffense5=SC5370
replace fifthServeOffense5=999 if fifthServeOffense5==998
tab fifthServeOffense5
***Fifth serve admission Month***
tab SC5385, nol
gen fifthAdmitMonth=99 
replace fifthAdmitMonth=SC5385 if SC5385!=98 
tab fifthAdmitMonth
***Fifth serve admission Year***
tab SC5390, nol
gen fifthAdmitYear=99
replace fifthAdmitYear=SC5390 if SC5390!=98 
tab fifthAdmitYear
***Fifth serve Age***
tab SC5400
gen fifthAdmitAge=SC5400
replace fifthAdmitAge=99 if fifthAdmitAge==98 
tab fifthAdmitAge
***Fifth serve as adult***
tab SC5375, nol
gen fifthServeAdult=9
replace fifthServeAdult=1 if (SC5375==1|SC5375==2) 
replace fifthServeAdult=0 if SC5375==3
tab fifthServeAdult



***Sixth serve offense 1***
tab SC5430, nol
gen sixthServeOffense1=SC5430
replace sixthServeOffense1=999 if sixthServeOffense1==998
tab sixthServeOffense1
***Sixth serve offense 2***
tab SC5435, nol
gen sixthServeOffense2=SC5435
replace sixthServeOffense2=999 if sixthServeOffense2==998
tab sixthServeOffense2
***Sixth serve offense 3***
tab SC5440, nol
gen sixthServeOffense3=SC5440
replace sixthServeOffense3=999 if sixthServeOffense3==998
tab sixthServeOffense3
***Sixth serve offense 4***
tab SC5445, nol
gen sixthServeOffense4=SC5445
replace sixthServeOffense4=999 if sixthServeOffense4==998
tab sixthServeOffense4
***Sixth serve offense 5***
tab SC5450, nol
gen sixthServeOffense5=SC5450
replace sixthServeOffense5=999 if sixthServeOffense5==998
tab sixthServeOffense5
***Sixth serve admission Month***
tab SC5465, nol
gen sixthAdmitMonth=99
replace sixthAdmitMonth=SC5465 if SC5465!=98
tab sixthAdmitMonth
***Sixth serve admission Year***
tab SC5470, nol
gen sixthAdmitYear=99
replace sixthAdmitYear=SC5470 if SC5470!=98  
tab sixthAdmitYear
***Sixth serve Age***
tab SC5480
gen sixthAdmitAge=SC5480
replace sixthAdmitAge=99 if sixthAdmitAge==98 
tab sixthAdmitAge
***Sixth serve as adult***
tab SC5455, nol
gen sixthServeAdult=9
replace sixthServeAdult=1 if (SC5455==1 | SC5455==2 ) 
replace sixthServeAdult=0 if SC5455==3 
tab sixthServeAdult



***Seventh serve offense 1***
tab SC5510, nol
gen seventhServeOffense1=SC5510
replace seventhServeOffense1=999 if seventhServeOffense1==998
tab seventhServeOffense1
***Seventh serve offense 2***
tab SC5515, nol
gen seventhServeOffense2=SC5515
replace seventhServeOffense2=999 if seventhServeOffense2==998
tab seventhServeOffense2
***Seventh serve offense 3***
tab SC5520, nol
gen seventhServeOffense3=SC5520
replace seventhServeOffense3=999 if seventhServeOffense3==998
tab seventhServeOffense3
***Seventh serve offense 4***
tab SC5525, nol
gen seventhServeOffense4=SC5525
replace seventhServeOffense4=999 if seventhServeOffense4==998
tab seventhServeOffense4
***Seventh serve offense 5***
tab SC5530, nol
gen seventhServeOffense5=SC5530
replace seventhServeOffense5=999 if seventhServeOffense5==998
tab seventhServeOffense5
***Seventh serve admission Month***
tab SC5545, nol
gen seventhAdmitMonth=99
replace seventhAdmitMonth=SC5545 if SC5545!=98
tab seventhAdmitMonth
***Seventh serve admission Year***
tab SC5550, nol
gen seventhAdmitYear=99
replace seventhAdmitYear=SC5550 if SC5550!=98 
tab seventhAdmitYear
***Seventh serve Age***
tab SC5560
gen seventhAdmitAge=SC5560
replace seventhAdmitAge=99 if seventhAdmitAge==98 
tab seventhAdmitAge
***Seventh serve as adult***
tab SC5535, nol
gen seventhServeAdult=9
replace seventhServeAdult=1 if (SC5535==1 | SC5535==2 )
replace seventhServeAdult=0 if SC5535==3
tab seventhServeAdult



***Eighth serve offense 1***
tab SC5590, nol
gen eighthServeOffense1=SC5590
replace eighthServeOffense1=999 if eighthServeOffense1==998
tab eighthServeOffense1
***Eighth serve offense 2***
tab SC5595, nol
gen eighthServeOffense2=SC5595
replace eighthServeOffense2=999 if eighthServeOffense2==998
tab eighthServeOffense2
***Eighth serve offense 3***
tab SC5600, nol
gen eighthServeOffense3=SC5600
replace eighthServeOffense3=999 if eighthServeOffense3==998
tab eighthServeOffense3
***Eighth serve offense 4***
tab SC5605, nol
gen eighthServeOffense4=SC5605
replace eighthServeOffense4=999 if eighthServeOffense4==998
tab eighthServeOffense4
***Eighth serve offense 5***
tab SC5610, nol
gen eighthServeOffense5=SC5610
replace eighthServeOffense5=999 if eighthServeOffense5==998
tab eighthServeOffense5
***Eighth serve admission Month***
tab SC5625, nol
gen eighthAdmitMonth=99
replace eighthAdmitMonth=SC5625 if SC5625!=98
tab eighthAdmitMonth
***Eighth serve admission Year***
tab SC5630, nol
gen eighthAdmitYear=99
replace eighthAdmitYear=SC5630 if SC5630!=98 
tab eighthAdmitYear
***Eighth serve Age***
tab SC5640
gen eighthAdmitAge=SC5640
replace eighthAdmitAge=99 if eighthAdmitAge==98 
tab eighthAdmitAge
***Eighth serve as adult***
tab SC5615, nol
gen eighthServeAdult=9
replace eighthServeAdult=1 if (SC5615==2 | SC5615==1 ) 
replace eighthServeAdult=0 if SC5615==3 
tab eighthServeAdult



***Ninth serve offense 1***
tab SC5670, nol
gen ninthServeOffense1=SC5670
replace ninthServeOffense1=999 if ninthServeOffense1==998
tab ninthServeOffense1
***Ninth serve offense 2***
tab SC5675, nol
gen ninthServeOffense2=SC5675
replace ninthServeOffense2=999 if ninthServeOffense2==998
tab ninthServeOffense2
***Ninth serve offense 3***
tab SC5680, nol
gen ninthServeOffense3=SC5680
replace ninthServeOffense3=999 if ninthServeOffense3==998
tab ninthServeOffense3
***Ninth serve offense 4***
tab SC5685, nol
gen ninthServeOffense4=SC5685
replace ninthServeOffense4=999 if ninthServeOffense4==998
tab ninthServeOffense4
***Ninth serve offense 5***
tab SC5690, nol
gen ninthServeOffense5=SC5690
replace ninthServeOffense5=999 if ninthServeOffense5==998
tab ninthServeOffense5
***Ninth serve admission Month***
tab SC5705, nol
gen ninthAdmitMonth=99 
replace ninthAdmitMonth=SC5705 if SC5705!=98
tab ninthAdmitMonth
***Ninth serve admission Year***
tab SC5710, nol
gen ninthAdmitYear=99
replace ninthAdmitYear=SC5710 if SC5710!=98 
tab ninthAdmitYear
***Ninth serve Age***
tab SC5720, nol
gen ninthAdmitAge=SC5720
replace ninthAdmitAge=99 if ninthAdmitAge==98 
tab ninthAdmitAge
***Ninth serve as adult***
tab SC5695, nol
gen ninthServeAdult=9
replace ninthServeAdult=1 if (SC5695==1 | SC5695==2 )
replace ninthServeAdult=0 if SC5695==3 
tab ninthServeAdult


***Tenth serve offense 1***
tab SC5750, nol
gen tenthServeOffense1=SC5750
replace tenthServeOffense1=999 if tenthServeOffense1==995
tab tenthServeOffense1
***Tenth serve offense 2***
tab SC5755, nol
gen tenthServeOffense2=SC5755
replace tenthServeOffense2=999 if tenthServeOffense2==995
tab tenthServeOffense2
***Tenth serve offense 3***
tab SC5760, nol
gen tenthServeOffense3=SC5760
replace tenthServeOffense3=999 if tenthServeOffense3==995
tab tenthServeOffense3
***Tenth serve offense 4***
tab SC5765, nol
gen tenthServeOffense4=SC5765
replace tenthServeOffense4=999 if tenthServeOffense4==995
tab tenthServeOffense4
***Tenth serve offense 5***
tab SC5770, nol
gen tenthServeOffense5=SC5770
replace tenthServeOffense5=999 if tenthServeOffense5==995
tab tenthServeOffense5
***Tenth serve admission Month***
tab SC5785, nol
gen tenthAdmitMonth=99
replace tenthAdmitMonth=SC5785 if SC5785!=98
tab tenthAdmitMonth
***Tenth serve admission Year***
tab SC5790, nol
gen tenthAdmitYear=99
replace tenthAdmitYear=SC5790 if SC5790!=98 
tab tenthAdmitYear
***Tenth serve Age***
tab SC5800, nol
gen tenthAdmitAge=SC5800
replace tenthAdmitAge=99 if tenthAdmitAge==98 
tab tenthAdmitAge
***Tenth serve as adult***
tab SC5775, nol
gen tenthServeAdult=9
replace tenthServeAdult=1 if (SC5775==1|SC5775==2) 
replace tenthServeAdult=0 if SC5775==3 
tab tenthServeAdult


*****Social Economic Status*****
****has GED or Highschool Equivalent****
tab SC6390, nol
gen hasGedEqui=9
replace hasGedEqui=1 if SC6390==1
replace hasGedEqui=0 if SC6390==2
tab hasGedEqui
 
***Highest Grade Attended (no missing data)*** 
tab SC6380, nol
gen topGradeAttended=SC6380 if SC6380!=98
tab topGradeAttended

***Highest Grade Completed***
tab SC6385, nol
gen topGradeCompleted=99
replace topGradeCompleted=topGradeAttended if SC6385==1
replace topGradeCompleted=topGradeAttended-1 if SC6385==2
replace topGradeCompleted=0 if SC6380==0
tab topGradeCompleted

***Completed high school***
gen completeHighSchool=9
replace completeHighSchool=1 if topGradeCompleted>=12 & topGradeCompleted!=99
replace completeHighSchool=0 if topGradeCompleted<12
tab completeHighSchool

/***Any Formal Training or Job Skills***
gen formalTraining=9
replace formalTraining=1 if V496==1 
replace formalTraining=0 if V496==2
tab formalTraining
*/ 

***Job before Offense (month before admission)***
tab SC6395, nol
gen jobAtOffense=9
replace jobAtOffense=1 if SC6395==1  
replace jobAtOffense=0 if  SC6395==2
tab jobAtOffense

***Full Time Job***
tab SC6400, nol
gen fullTimeJob=9
replace fullTimeJob=1 if SC6400==1 
replace fullTimeJob=0 if  (SC6400==2 | SC6395==2 )
tab fullTimeJob

***Looking for Job***
tab SC6410, nol
gen lookForJob=9
replace lookForJob=1 if SC6410==1 
replace lookForJob=0 if SC6410==2
tab lookForJob

***Major Reason not Looking for Jobs***
tab SC6490, nol
gen reasonNotLooking=99 
replace reasonNotLooking=SC6490 if SC6490!=98
tab reasonNotLooking

/***Year last worked at a job ***
When did you last work at a job or business for at least 2       
     consecutive weeks? Exclude work done while in jail or prison: [Year]      
*/
tab SC6500, nol
gen yearLastWorked=99
replace yearLastWorked=SC6500 if SC6500!=98 
tab yearLastWorked

***Never Worked for 2 consecutive weeks***
tab SC6505, nol 
gen neverWorked=9
replace neverWorked=1 if (SC6505==0|SC6505==1)
replace neverWorked=0 if yearLastWorked!=99
tab neverWorked

***Free at least for one year before admission*** 
tab SC6520, nol
tab SC8885, nol
gen freeAYear=9
replace freeAYear=1 if SC6520==1
replace freeAYear=0 if (SC6520==2| SC8885==2)
tab freeAYear

***Monthly Income Received (during free time)***
tab SC6575, nol
gen monthIncome=9999
replace monthIncome=0 if SC6575==0 
replace monthIncome=50 if SC6575==1 
replace monthIncome=150 if SC6575==2 
replace monthIncome=250 if SC6575==3 
replace monthIncome=350 if SC6575==4
replace monthIncome=450 if SC6575==5
replace monthIncome=550 if SC6575==6
replace monthIncome=700 if SC6575==7
replace monthIncome=900 if SC6575==8
replace monthIncome=1100 if SC6575==9 
replace monthIncome=1350 if SC6575==10 
replace monthIncome=1750 if SC6575==11
replace monthIncome=2250 if SC6575==12
replace monthIncome=3750 if SC6575==13
replace monthIncome=5000 if SC6575==14
tab monthIncome

***Annual Income (year before the arrest)***
tab SC6620, nol 
gen annualIncome=9999999
replace annualIncome=0 if SC6620==0 
replace annualIncome=500 if SC6620==1 
replace annualIncome=1500 if SC6620==2 
replace annualIncome=2500 if SC6620==3 
replace annualIncome=3500 if SC6620==4 
replace annualIncome=4500 if SC6620==5 
replace annualIncome=5500 if SC6620==6
replace annualIncome=6750 if SC6620==7
replace annualIncome=8750 if SC6620==8 
replace annualIncome=11000 if SC6620==9
replace annualIncome=13500 if SC6620==10
replace annualIncome=17500 if SC6620==11
replace annualIncome=22500 if SC6620==12
replace annualIncome=37500 if SC6620==13
replace annualIncome=50000 if SC6620==14
tab annualIncome

***When free, receiving wage (1991: a year ago)***
tab SC6580, nol
gen receiveWage=9
replace receiveWage=1 if SC6580==1
replace receiveWage=0 if SC6580==98  
tab receiveWage

***When free, receiving SSI, welfare, UI
tab SC6585
tab SC6590
tab SC6595
gen receiveSsi=9
replace receiveSsi=1 if (SC6585==2 | SC6590==3 | SC6595==4)
replace receiveSsi=0 if (SC6585!=2 & SC6590!=3 & SC6595!=4) 
tab receiveSsi

***When free, receiving from family and friends***
tab SC6600, nol
gen receiveFAndF=9
replace receiveFAndF=1 if SC6600==5 
replace receiveFAndF=0 if SC6600!=5 
tab receiveFAndF
***When free, receiving illegal income***
tab SC6605, nol
gen receiveIllegalIncome=9
replace receiveIllegalIncome=1 if SC6605==6 
replace receiveIllegalIncome=0 if SC6605!=6 
tab receiveIllegalIncome
***When free, receiving education grant***
tab SC6610, nol
gen receiveEducGrant=9
replace receiveEducGrant=1 if SC6610==7
replace receiveEducGrant=0 if SC6610!=7 
tab receiveEducGrant
***When free, receiving anything else***
tab SC6615, nol
gen receiveAnythingElse=9
replace receiveAnythingElse=1 if SC6615==8
replace receiveAnythingElse=0 if SC6615!=8 
tab receiveAnythingElse
***Source of Income (Illegal: Most of it and some of it)***
tab SC6625, nol
gen illegalIncome=9
replace illegalIncome=1 if SC6625==1 | SC6625==2
replace illegalIncome=0 if SC6625==3 | SC6625==8
tab illegalIncome

***Support Someone Before Arrest***
tab SC6630, nol
gen supportOthersBeforeArrest=9
replace supportOthersBeforeArrest=1 if SC6630==1
replace supportOthersBeforeArrest=0 if SC6630==2
tab supportOthersBeforeArrest

***Number of Brothers and sisters***
tab SC6710, nol
gen numberSiblings=99
replace numberSiblings=SC6710 if SC6710!=98 
tab numberSiblings
 
***Who grow up with: Mother only*** 
tab SC6685, nol
gen growUpMotherOnly=9
replace growUpMotherOnly=1 if SC6685==1 
replace growUpMotherOnly=0 if SC6685!=1 & SC6685!=98 
tab growUpMotherOnly

***Who grow up with: Father only*** 
gen growUpFatherOnly=9
replace growUpFatherOnly=1 if SC6685==2 
replace growUpFatherOnly=0 if SC6685!=2 & SC6685!=98 
tab growUpFatherOnly

***Who grow up with: both parents*** 
gen growUpBothParents=9
replace growUpBothParents=1 if SC6685==3 
replace growUpBothParents=0 if SC6685!=3 & SC6685!=98 
tab growUpBothParents

***Who grow up with: Grandparents*** 
gen growUpGrandParents=9
replace growUpGrandParents=1 if SC6685==4
replace growUpGrandParents=0 if SC6685!=4 & SC6685!=98 
tab growUpGrandParents

***Who grow up with: Other relatives*** 
gen growUpOtherRelatives=9
replace growUpOtherRelatives=1 if SC6685==5
replace growUpOtherRelatives=0 if SC6685!=5 & SC6685!=98 
tab growUpOtherRelatives

***Who grow up with: Friends*** 
gen growUpFriends=9
replace growUpFriends=1 if SC6685==6
replace growUpFriends=0 if SC6685!=6 & SC6685!=98 
tab growUpFriends

***Who grow up with: Foster homes and institutions*** 
gen growUpFosterInst=99
replace growUpFosterInst=1 if SC6685==7 | SC6685==8
replace growUpFosterInst=0 if SC6685!=7 & SC6685!=8 & SC6685!=98
tab growUpFosterInst

***Who grow up with: Somewhere else*** 
gen growUpElse=99
replace growUpElse=1 if SC6685==9
replace growUpElse=0 if SC6685!=9 & SC6685!=98 
tab growUpElse

/***Oldest Child***
tab V571 
gen oldestChild=9
replace oldestChild=1 if V571==1
replace oldestChild=0 if V571==2

***Highest Grade Mother Attended***
tab V578, nol
gen higestGradeMother=99
replace higestGradeMother=V578 if V578!=97 & V578!=98 & V578!=99
tab higestGradeMother

***Highest Grade Father Attended***
tab V582, nol 
gen higestGradeFather=99
replace higestGradeFather=V582 if V582!=97 & V582!=98 & V582!=99
tab higestGradeFather
*/ 
***Gorw up with parents drug and alcohol abusing*** 
tab SC6700, nol
gen growUpParentsDrugAlcohol=9
replace growUpParentsDrugAlcohol=1 if SC6700==1
replace growUpParentsDrugAlcohol=0 if SC6700==2
tab growUpParentsDrugAlcohol

***Anyone in family ever served in jail or prison***
tab SC6715, nol
gen familyServed=9
replace familyServed=1 if SC6715==1 
replace familyServed=0 if SC6715==2
tab familyServed

***Mother served before***
tab SC6725, nol
gen motherServed=9
replace motherServed=1 if SC6725==2 
replace motherServed=0 if (SC6725==8 | SC6715==2) & familyServed!=9
tab motherServed

***Father served before***
tab SC6730, nol
gen fatherServed=9
replace fatherServed=1 if SC6730==3
replace fatherServed=0 if (SC6730==8 | SC6715==2) & familyServed!=9
tab fatherServed

***Be abused physically before***
tab SC7035, nol
tab SC7040, nol
tab SC7050, nol
tab SC7070, nol

gen abusedPhyBefore=9 
replace abusedPhyBefore=1 if (SC7035==3 & (SC7040==4 | SC7040==6)) & (SC7050==1|SC7070==1|SC7070==3)
replace abusedPhyBefore=0 if  (SC7035==1 | SC7040==5 | SC7050==2 | SC7070==2 )
tab abusedPhyBefore

***Be abused sexually before 18***
gen abusedSexBefore=9 
replace abusedSexBefore=1 if (SC7035==3 & (SC7040==5 | SC7040==6)) & (SC7050==1|SC7070==1|SC7070==3)
replace abusedSexBefore=0 if  (SC7035==1 | SC7040==4 | SC7050==2 | SC7070==2 ) 
tab abusedSexBefore

***Be abused both sexually and physically before 18***
gen abusedSexnPhyBefore=9 
replace abusedSexnPhyBefore=1 if SC7040==6 & (SC7050==1|SC7070==1|SC7070==3)
replace abusedSexnPhyBefore=0 if (SC7040!=6 & SC7040!=8) | SC7035==1 | SC7040==4 | SC7050==2 | SC7070==2
tab abusedSexnPhyBefore

***Have Children***
tab SC6745, nol
gen haveChildren=9 
replace haveChildren=1 if SC6745==1
replace haveChildren=0 if SC6745==2
tab haveChildren

/***Friends who engage in illegal activities***
gen friendsDoIllegal=9
replace friendsDoIllegal=1 if (V952==1|V953==2|V954==3|V955==4|V956==5|V957==6|V958==7| ///
V959==8|V960==9|V961==10)
replace friendsDoIllegal=0 if V962==0 
tab friendsDoIllegal
*/ 

***Ever use any drugs***
tab SC7090, nol 
tab SC7125, nol 
tab SC7160, nol
tab SC7195, nol
tab SC7230, nol 
tab SC7265, nol 
tab SC7300, nol 
tab SC7335, nol 
tab SC7370, nol 
tab SC7405, nol
tab SC7530, nol
tab SC7565, nol 

gen everUseDrug=9 
replace everUseDrug=1 if SC7090==1 
replace everUseDrug=1 if SC7125==1 
replace everUseDrug=1 if SC7160==1
replace everUseDrug=1 if SC7195==1
replace everUseDrug=1 if SC7230==1 
replace everUseDrug=1 if SC7265==1 
replace everUseDrug=1 if SC7300==1 
replace everUseDrug=1 if SC7335==1 
replace everUseDrug=1 if SC7370==1 
replace everUseDrug=1 if SC7405==1 
replace everUseDrug=1 if SC7530==1 
replace everUseDrug=1 if SC7565==1 

replace everUseDrug=0 if (SC7090==2 & SC7125==2 & SC7160==2 & SC7195==2 & /// 
SC7230==2 & SC7265==2 & SC7300==2 & SC7335==2 & SC7370==2 & SC7405==2 & /// 
SC7530==2 & SC7565==2 )

tab everUseDrug

***Age First Use Drugs***
tab SC7095, nol 
tab SC7130, nol 
tab SC7165, nol
tab SC7200, nol
tab SC7235, nol 
tab SC7270, nol 
tab SC7305, nol 
tab SC7340, nol 
tab SC7375, nol 
tab SC7500, nol
tab SC7535, nol
tab SC7570, nol 

gen ageFirstUseAnyDrugs=99
replace ageFirstUseAnyDrugs=min(SC7095, SC7130, SC7165, SC7200, SC7235, SC7270, SC7305, /// 
SC7340, SC7375, SC7500, SC7535, SC7570) 
replace ageFirstUseAnyDrugs=99 if ageFirstUseAnyDrugs==98
tab ageFirstUseAnyDrugs 

***Ever use any drugs on a regular basis***
tab SC7105, nol 
tab SC7140, nol 
tab SC7175, nol
tab SC7210, nol
tab SC7245, nol 
tab SC7280, nol 
tab SC7315, nol 
tab SC7350, nol 
tab SC7385, nol 
tab SC7510, nol
tab SC7545, nol
tab SC7580, nol 

gen useDrugReg=9 
replace useDrugReg=1 if SC7105==1 
replace useDrugReg=1 if SC7140==1 
replace useDrugReg=1 if SC7175==1
replace useDrugReg=1 if SC7210==1
replace useDrugReg=1 if SC7245==1 
replace useDrugReg=1 if SC7280==1 
replace useDrugReg=1 if SC7315==1 
replace useDrugReg=1 if SC7350==1 
replace useDrugReg=1 if SC7385==1 
replace useDrugReg=1 if SC7510==1 
replace useDrugReg=1 if SC7545==1 
replace useDrugReg=1 if SC7580==1 

replace useDrugReg=0 if everUseDrug==0 

replace useDrugReg=0 if ((SC7090==2 | SC7105==2) & (SC7125==2 | SC7140==2) & ///
 (SC7160==2 | SC7175==2) & (SC7195==2 | SC7210==2) & (SC7230==2 | SC7245==2) & /// 
 (SC7265==2 | SC7280==2) & (SC7300==2 | SC7315==2) & (SC7335==2 | SC7350==2) & /// 
 (SC7370==2 | SC7385==2) & (SC7405==2 | SC7510==2) & (SC7530==2 | SC7545==2) & ///
 (SC7565==2 | SC7580==2))   
 
tab useDrugReg
tab everUseDrug

/***Age First Use Drugs on a regular basis***
tab V905, nol 
tab V916, nol 
tab V925, nol 
tab V934, nol
tab V943, nol 
tab V952, nol 
tab V961, nol 
tab V970, nol 
tab V979, nol
tab V988, nol 

drop ageFirstUseDrugsRegular
gen ageFirstUseDrugsRegular=99
replace ageFirstUseDrugsRegular=min(V905, V916, V925, V934, V943, V952, V961, /// 
V970, V979, V988) 
replace ageFirstUseDrugsRegular=99 if (ageFirstUseDrugsRegular==97 | ageFirstUseDrugsRegular==98) 
tab ageFirstUseDrugsRegular
*/ 
***Whether using drugs before the current offense (1991: current arrest)***
tab SC7110, nol 
tab SC7145, nol 
tab SC7180, nol
tab SC7215, nol
tab SC7250, nol 
tab SC7285, nol 
tab SC7320, nol 
tab SC7355, nol 
tab SC7390, nol 
tab SC7515, nol
tab SC7550, nol
tab SC7585, nol 

gen useDrugBeforeCurrentOffense=9 
replace useDrugBeforeCurrentOffense=1 if (SC7110==1 | SC7145==1 | SC7180==1 | SC7215==1 | /// 
SC7250==1 | SC7285==1 | SC7320==1 | SC7355==1 | SC7390==1 | SC7515==1 | SC7550==1 | SC7585==1)

replace useDrugBeforeCurrentOffense=0 if ((SC7090==2 | SC7110==2) & (SC7125==2 | SC7145==2) & ///
 (SC7160==2 | SC7180==2) & (SC7195==2 | SC7215==2) & (SC7230==2 | SC7250==2) & /// 
 (SC7265==2 | SC7285==2) & (SC7300==2 | SC7320==2) & (SC7335==2 | SC7355==2) & /// 
 (SC7370==2 | SC7390==2) & (SC7405==2 | SC7515==2) & (SC7530==2 | SC7550==2) & ///
 (SC7565==2 | SC7585==2))   

tab useDrugBeforeCurrentOffense

/***Whether using drugs before the first offense***
tab V625, nol
tab V641, nol
tab V657, nol
tab V673, nol 
tab V689, nol 
tab V705, nol 
tab V721, nol 
tab V737, nol
tab V753, nol

drop useDrugBeforeFirstOffense
gen useDrugBeforeFirstOffense=9 
replace useDrugBeforeFirstOffense=1 if (V625==1 | V641==1 | V657==1 | V673==1 | /// 
V689==1 | V705==1 | V721==1 | V737==1 | V753==1)
replace useDrugBeforeFirstOffense=0 if ((V625==2 & V641==2 & V657==2 & V673==2 & /// 
V689==2 & V705==2 & V721==2 & V737==2 & V753==2) | (V625==9 & V641==9 & V657==9 & V673==9 & /// 
V689==9 & V705==9 & V721==9 & V737==9 & V753==9) )
tab useDrugBeforeFirstOffense
*/ 
/***Whether participated in any drug treatment program 
tab V1010, nol 
gen useDrugProgram=9
replace useDrugProgram=1 if V1010==1 
replace useDrugProgram=0 if V1010==2
tab useDrugProgram
*/ 

***Under the influence of drug for the current offense 
tab SC7665, nol 
tab everUseDrug
tab useDrugBeforeCurrentOffense
gen underDrugInfluence=9
replace underDrugInfluence=1 if SC7665==1 
replace underDrugInfluence=0 if (SC7665==2 | useDrugBeforeCurrentOffense==0 )
tab underDrugInfluence

save sisfcf_1991_federal, replace 




























